package com.shujia.spring.mvc.service;

import com.shujia.spring.mvc.bean.User;
import com.shujia.spring.mvc.dao.UserDao;
import com.shujia.spring.mvc.dao.UserDaoImpl;

public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDaoImpl();
    @Override
    public String login(String username, String password) {
        User user = userDao.selectUser(username);
        if (user==null){
            return "用户不存在";
        }
        if(!user.getPassword().equals(password)){
            return "密码不正确";
        }
        return "登录成功！";
    }
}
